package apps

import (
	"context"
	"github.com/beherochuling/beesoft_api/app/dao"
	"github.com/beherochuling/beesoft_api/app/model/entity"

	"github.com/beherochuling/beesoft_api/app/helper/net"
	"github.com/beherochuling/beesoft_api/app/model"
	"github.com/beherochuling/beesoft_api/app/model/apps"
)

var Node node

type node struct{}

func (v *node) List(ctx context.Context, req *apps.NodeListRequest) (net.ErrorCode, []entity.NetworkNodes) { // *apps.NodeListResponse) {
	// res := new(apps.NodeListResponse)

	var items []entity.NetworkNodes
	err := dao.NetworkNodes.Ctx(ctx).
		// Where(dao.NetworkNodes.Columns().CategoryId, req.CategoryId).
		Scan(&items)
	if err != nil {
		panic(err)
	}

	return model.SuccessCode, items
}
func (v *node) Show(ctx context.Context, req *apps.NodeShowRequest) (net.ErrorCode, *apps.NodeShowResponse) {
	res := new(apps.NodeShowResponse)

	return model.SuccessCode, res
}
func (v *node) Store(ctx context.Context, req *apps.NodeShowRequest) {

}
func (v *node) UpdateById(ctx context.Context, req *apps.NodeUpdateRequest) {

}
func (v *node) DestroyById(ctx context.Context) { // , req *apps.nodeDestroyRequest

}
